﻿using Microsoft.AspNetCore.Cryptography.KeyDerivation;

namespace Lightworks.Core.Utils
{
    public static class HashHelper
    {

        public static string HashPwd(string password, byte[] salt)
        {
            if (string.IsNullOrEmpty(password)) { return string.Empty; }
            var valBytes = KeyDerivation.Pbkdf2(password, salt, KeyDerivationPrf.HMACSHA512, 100, 32);
            return Convert.ToBase64String(valBytes);
        }
    }
}